# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-crc8
pkgver=0.1.0
pkgrel=4
pkgdesc="A module with the CRC8 algorithm for Python"
url="https://github.com/niccokunzmann/crc8"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/niccokunzmann/crc8/archive/v$pkgver.tar.gz")
sha512sums=('668ba114066d8a3b2fe292d43fab66d98dc8e54c312863bcc3c85030a40cde0c9ca0d4fcffbc81225dc35629491e58e69aaae698e0abb4bb7431f6b4d285246c')

build() {
  cd crc8-$pkgver
  python setup.py build
}

check() {
  cd crc8-$pkgver
  python test_crc8.py
}

package() {
  cd crc8-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
